//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.aidong.dao.wills;

import com.aidong.dao.base.ConditionMap;
import com.aidong.dao.base.Pagination;
import com.aidong.dao.wills.BaseDao;
import com.aidong.model.wills.PssProductStockHis;
import com.aidong.model.wills.PssProductStockHisExt;
import com.aidong.model.wills.PssProductStockHisPK;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.springframework.stereotype.Repository;

@Repository
public class PssProductStockHisDao extends BaseDao<PssProductStockHis, PssProductStockHisPK> {
    public PssProductStockHisDao() {
    }

    public void getProductStockHisLst(Pagination<PssProductStockHisExt> pagination, ConditionMap cd) {
        ArrayList params = new ArrayList();
        String sqlw = cd.toSql(params);
        String sql = " select a.ShopCode, a.ProductCode, a.Quantity, a.SaveMonth, b.Unit \nfrom PssProductStockHis a \ninner join PssProductCode b on a.ProductCode = b.ProductCode \n" + (sqlw.length() > 0?"where " + sqlw:"");
        sql = sql + "  order by a.ShopCode,a.ProductCode \n";
        this.queryPageListBySql(PssProductStockHisExt.class, pagination, sql, params.toArray());
    }

    public void addHisStockList(List<PssProductStockHis> pssCheckList) {
        Iterator i$ = pssCheckList.iterator();

        while(i$.hasNext()) {
            PssProductStockHis pcl = (PssProductStockHis)i$.next();
            this.getSession().save(pcl);
        }

    }
}
